package com.dlsy.ygj.action.system;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.dlsy.ygj.biz.system.impl.CazuorizhiBiz;
import com.dlsy.ygj.entity.Cazuorizhi;
import com.dlsy.ygj.entity.EmLeave;

public class CazuorizhiAction {
	private CazuorizhiBiz cazuorizhiBiz;

	public CazuorizhiBiz getCazuorizhiBiz() {
		return cazuorizhiBiz;
	}

	public void setCazuorizhiBiz(CazuorizhiBiz cazuorizhiBiz) {
		this.cazuorizhiBiz = cazuorizhiBiz;
	}
	public String cazuorizhiA(){
		return "secuess";
	}
	public String caozuorizhiSelect() throws NumberFormatException, Exception{
		HttpServletRequest request = ServletActionContext.getRequest();
		int type = Integer.parseInt(request.getParameter("type"));
		String emNO = request.getParameter("emNO");
		String begin = request.getParameter("begin");
		String end = request.getParameter("end");
		List<Cazuorizhi> list = null;
		if (null==emNO||"".equals(emNO)) {
			list = cazuorizhiBiz.findByDate(type,Integer.parseInt(request.getSession().getAttribute("storefrontId").toString()),null,begin,end);
		}else {
			 list = cazuorizhiBiz.findByDate(type,Integer.parseInt(request.getSession().getAttribute("storefrontId").toString()),emNO,begin,end);
		}
		request.setAttribute("wtmlist",list);
		return "secuess";
	}
}
